# 通过占位的形式，进行拼接
name = "Leon"
message = "My name is %s" % name
print(message)

# 通过占位的形式，完成数字和字符串的拼接
my_id = 11
age = 21
message = "Remember find me in numer %s号，and my age is %s" % (my_id,age)
print(message)

name = "Leo"
graduate_year = 2027
salary = 10.1
message = "His name is %s,graduating in %d,and he get %fk a month" % (name,graduate_year,salary)
print(message)

num1 = 11
num2 = 11.345
print("数字11宽度限制5，结果是：%5d" % num1)
print("数字11宽度限制1，结果是：%1d" % num1)
print("数字11.345宽度限制7，小数精度2，结果是：%7.2f" % num2)
print("数字11.345宽度不限制，小数精度2，结果是：%.2f" % num2)

'''
快速字符串格式化 ：   f"{占位}"
'''

name = "Leon and his friends"
set_up_year = 2004
stock_price = 19.99
# f:format
print(f"我是{name}，我成立于:{set_up_year}年,我今天的股价是{stock_price}元")

